#pragma once
#include <json/json.h>
#include <fstream>
#include <string>

namespace net_tools::base{
class Json{
 public:
  Json();
  ~Json();
  bool Open_read(std::string address);
  bool Open_write(std::string address);
  void Json_write(::Json::Value* root);
  void Read_from_ifs(::Json::Value* root);
 private:
  std::ifstream         ifs_;
  std::ofstream         ofs_;
  ::Json::StreamWriter* write_;
  ::Json::CharReader*   read_;
};

} // namespace net_tools::base